import React from 'react'
import { withRouter } from 'react-router-dom'

const Link = ({ to, children, ...props }) => {
    return (
        <a href={to} {...props} onClick={(e) => {
            e.preventDefault()
            props.history.push(to)
        }}>{children}</a>
    )
}

export default withRouter(Link)